﻿#ifndef TYPEDEFS_H
#define TYPEDEFS_H

#include <QtGlobal>

typedef quint8  u8;
typedef quint16 u16;

typedef unsigned char BYTE;

//2.9.	启动/暂停/继续/停止比赛，功能码0x14
//    00-	清零
//    01-	启动
//    02-	暂停
//    03-	继续
//    04-	停止
typedef enum LED_STATUS
{
    STATUS_LED_NULL = 0,
    STATUS_LED_START,
    STATUS_LED_PAUSE,
    STATUS_LED_CONTINUE,
    STATUS_LED_STOP
};

typedef enum PLAY_STATUS
{
    STATUS_PLAYING_NULL = 0,
    STATUS_PLAYING_FIRST_HALF,
    STATUS_PLAYING_HALF_PAUSE,
    STATUS_PLAYING_SECOND_HALF,
    STATUS_PLAYING_EXT_TIME,
    STATUS_PLAYING_END
};

enum enumCmd_Code {
    Cmd_NULL = 0x00,
    Cmd_Comm_Check = 0x01,
    Cmd_Get_Version = 0x02,
    Cmd_RestartApp = 0x03,
    Cmd_Send_League_Level = 0x10, //div 1, div2
    Cmd_Send_Match_Time = 0x11, //
    Cmd_Send_Score = 0x12, //
    Cmd_Send_Vistor_Name = 0x13, //
    Cmd_Send_Start_Pause = 0x14,
    Cmd_Send_Card_ID = 0x15,
    Cmd_Send_Card_IP = 0x16,
    Cmd_Get_Para = 0x17,
    Cmd_Send_Brightness = 0x18
};

//搜索 登录 创建节目 就好了，不需要原来的db
enum enumNova_Step {
    Nova_Step_NULL = 0x00,
    Nova_Step_Login = 0x01,
    Nova_Step_Create_Prog = 0x02,
    Nova_Step_Edit_Prog = 0x03,
    Nova_Step_Make_Prog = 0x04,
    Nova_Step_Transfer_Prog = 0x05,
    Nova_Step_Get_PlayList = 0x06,
    Nova_Step_Delete_PlayList,
    Nova_Step_Start_PlayList,
    Nova_Step_Pause_PlayList,
    Nova_Step_Resume_PlayList,
    Nova_Step_Logout
};

enum enumNova_Cmd {
    Nova_Cmd_NULL = 0x00,
    Nova_Cmd_Send_Prog = 0x01,
    Nova_Cmd_Get_PlayList = 0x02,
    Nova_Cmd_Delete_PlayList = 0x03,
    Nova_Cmd_Start_PlayList = 0x04,
    Nova_Cmd_Pause_PlayList = 0x05,
    Nova_Cmd_Resume_PlayList = 0x06,
};

#pragma pack(1)

typedef struct tagLed_Cmd
{
    int    nCmd_Code;
    time_t tmSend;
};

//IP:192.168.001.100
//    GWIP:192.168.001.001
//    Mask:255.255.255.000
//    Port:02000
//    device_id:4
//    status:4
//    current_time:0
//    end_time:90:0
//    Div:Div1,Div2,Div3;
//Count:0:0
//    visiting_team:MARSEILLE
//                        speed:1
//                    brightness:3

typedef struct tagLed_Item
{
    char szIP[32];
    char szSubMask[32];
    char szGatewayIP[32];
    int  nPort;
    int  nDev_id;
    int  nPlayStatus;
    int  nElapseTime;
    int  nRegularTime;
    int  nExtTime;
    char szDiv_Level[32];
    int  nDiv_Num;
    int  nHomeScore;
    int  nVistorScore;
    char szVistorName[128];
    int  nVistorSpeed;
    int  nBrightness;
};

typedef struct tagProg_Item
{
    int nProg_Type; //0-视频, 1-图片, 2-文本
    bool bHalf_Time; //上下半场 0-上半场, 1-下半场
    char szSponsor_Name[64]; //赞助商
    char szProg_File[256]; //播放文件
    char szTimeStamp_File[256]; //时间戳文件，对应转换为视频文件，预览播放

    int nEffect_Type;
    int nDuration_Time;
};

typedef struct tagProg_identifier
{
    char szProg_Name[256]; //
    char szProg_identifier[256]; //
};

#pragma pack()

#endif // TYPEDEFS_H
